package model.validation;

import model.Circle;

public class CircleValidator implements ShapeValidator<Circle> {

    public static final String CIRCLE_DIAM_NEGATIVE = "CIRCLE_DIAM_NEGATIVE";

    @Override
    public void validate(Circle entity) {
        if (entity.getR() < 0) {
            throw new ShapeValidationException(CIRCLE_DIAM_NEGATIVE);
        }
    }
}
